package com.imooc;

public class FloatDemo {

	public static void main(String[] args) {
		// 定义一个单精度浮点型变量，存放1234.328
		//float f = 1234.328;//Type mismatch: cannot convert from double to 
		float f = 1234.328f;
		System.out.println("f="+f);
		
		//定义一个双精度浮点数
		double d = 4598.2341;
		double d1 = 2324.2323f;
		System.out.println("d="+d+" d1="+d1);
		
		//整型赋值给double(自动变为浮点型)
		double d2 = 123;
		System.out.println("d3="+d2);
	}

}
